home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / tools.doc < prev    next >
Text File  |  1995-03-31  |  11KB  |  240 lines

  1. (Comp.sys.handhelds) 
  2. Item: 1873 by frs at rci.dk 
  3. Author: Frank Ochoa 
  4.   Subj: Make Library on HP48sx and m-code tools 
  5.   Date: Fri Feb 01 1991 16:08  
  6.  
  7. [Note: The library is TOOLS.LIB; the original directory is TOOLS.  -jkh-] 
  8.  
  9. This is a Toolbox for m-code made by our member Frank. You can't reach 
  10. him from the unix net directly, but you can write to me or contact our 
  11. BBS in Denmark (lot of HP28/48 stuff). 
  12.  
  13.         Friedrich Schroeder     (Sysop, PPC - Denmark - BBS 
  14.                                  FIDO node 2:234/52 
  15.                                  +45 42 52 66 00; 2400 8N1) 
  16.         Internet : frs@rci.dk 
  17.  
  18.  
  19.                           TOOLS :System utilites 
  20.  
  21.     This  is a brief discription of the programs in TOOLS.DIR.  If you 
  22.     want an explanation of how the programs work try hacking it first. 
  23.     I might not have the time to explain how they work.  Some of these 
  24.     programs kan be made more compact,  faster or even obsolete.  I do 
  25.     not have a PC so its not very often that I see what's in the BBS. 
  26.  
  27.     1. 'DMEM'      - Display memory. 
  28.  
  29.     The  contents of memory is displayed in hexadecimal  format.  This 
  30.     program  creates a variable 'Dmem' in the current directory unless 
  31.     it already exists upwards in the directory path. 
  32.     keys: 
  33.     right,left  increment/decrement address by one 
  34.     down,up     increment/decrement address by #10h 
  35.     +,-         increment/decrement address by #100h 
  36.     *,/         increment/decrement address by #1000h 
  37.     backspace, 
  38.     DEL         increment/decrement address by #10000h 
  39.     EEX,NEG     page up/page down 
  40.     ------------------------------- o -------------------------------- 
  41.     NOTE:  The built in monitor,  started by pressing and releasing ON 
  42.     and D keys at the same time and thereafter pressing the  backspace 
  43.     key, can be an invalueable tool for correcting corrupted ram code. 
  44.     Built  in  ram  (#70000h thru #7FFFFh) is  displayed  starting  at 
  45.     #F0000h. Here is a discription of what the keys do. 
  46.     keys: 
  47.     +,-         increment/decrement address by one 
  48.     *,/         increment/decrement address by #100h 
  49.     up,down     increment/decrement address by #1000h 
  50.     0-9,A-F     poke hex character and increment address by one 
  51.                 (only ram memory can be changed) 
  52.     ENTER       display memory starting at address #100h 
  53.     NEG         display memory starting at address #F000Ah 
  54.                 (true address #7000Ah) 
  55.     EEX         show memory starting at address #80000h 
  56.                 (PORT 1) 
  57.     DEL         show memory starting at address #C0000h 
  58.                 (PORT 2) 
  59.     INV         show memory starting at address #F0A94h 
  60.                 (true address #70A94h) 
  61.     ------------------------------- o ------------------------------- 
  62.  
  63.     2. 'DECOM48'   - Decompile object 
  64.  
  65.     3. 'ASM48'     - Assemble string 
  66.  
  67.     These  two programs are almost the same as Wickes' ASCII  Encoding 
  68.     and  Decoding programs ( ->ASC & <-ASC  ).  The only deference  is 
  69.     that  a CRC checksum  and newline character ,#Ah,  is not used  in 
  70.     these programs.  DECOM48 will decompile any object,  including rom 
  71.     objects,  in  level one.  ASM48 will assemble a string  containing 
  72.     five  or more characters but does not check whether the  resulting 
  73.     object makes sence.  Care should be taken when using ASM48 because 
  74.     a memory loss can result.  Be sure to BACK up memory before  using 
  75.     this program!!! 
  76.  
  77.     4. 'DNL'     - Delet newline character from string (CHR 10) 
  78.  
  79.     This program will take a string,  which was decompiled with ->ASC, 
  80.     and  remove  all  newline  characters so that the  string  can  be 
  81.     compiled with ASM48. 
  82.  
  83.     5. 'XLIBS'     - Get LIBRARY information 
  84.  
  85.     This program will take a library's ID number in level one, real or 
  86.     binary,  and find the memory location of the objects that make  up 
  87.     the library. Try it - you'll like it. 
  88.  
  89.     6. '->LIB'     - Make library 
  90.  
  91.     This  program  takes  a directory name in level one  and  makes  a 
  92.     library  object  from the contents of that directory.  The  source 
  93.     directory  must be a subdirectory of the  current  directory.  The 
  94.     source  directory  must  not contain  subdirectories.  The  source 
  95.     directory  will be purged and the new library will be stored  with 
  96.     the directory's name. The source directory may contain some of the 
  97.     following reserved variables. 
  98.  
  99.     $ROMID    The  library's  ID  number  - (Real  or  Binary).   This 
  100.               variable  must  be  in  the  source  directory.   It  is 
  101.               recomended  that only numbers in the range 769 thru 1791 
  102.               be  used.  Numbers greater than 1791 can cause a  memory 
  103.               loss. 
  104.  
  105.     $TITLE    A  string  containing the name of the library.  If  this 
  106.               variable is missing then the name of the directory  will 
  107.               be used.  A null string, "", can be used to mean that no 
  108.               name is to be given. 
  109.  
  110.     $MESSAGE  An  Array of String type object which has  user  defined 
  111.               ERROR  messages.  For example #6FF01 DOERR displays  the 
  112.               first  error  message of Library 1791 (#6FFh).  See  the 
  113.               program  'S->ARRAY' and 'AR->STR' for information  about 
  114.               creating array of strings.  If this variable is  missing 
  115.               then no error messages are created. 
  116.               Note:  This is different from what is required from HP's 
  117.               MS-DOS  "USERLIB.EXE"  program  for  the  PC.  USERLIB's 
  118.               $MESSAGE  is  a list of name variables that contain  the 
  119.               error  message  strings.  USERLIB creates  an  Array  of 
  120.               String from this list of names. 
  121.  
  122.     $HIDDEN   A  list of names that are not to be shown in the library 
  123.               menu.  The objects stored under these names are included 
  124.               in the library. 
  125.  
  126.     $VISIBLE  A  list of names that will be shown in the library menu. 
  127.               Note:  $HIDDEN  has priority over $VISIBLE.  That  means 
  128.               that  if  both $HIDDEN and $VISIBLE are present  in  the 
  129.               directory only $HIDDEN will be used. 
  130.  
  131.     $VARS     A  list  of names that are not to be converted  to  XLIB 
  132.               names  within  objects in the library.  For  example  if 
  133.               there  exist an object stored under 'xxx' but this  same 
  134.               name  is  also  used within a program  for  a  different 
  135.               object,  then  the name 'xxx' is not changed to  a  XLIB 
  136.               name.  The  object stored under 'xxx' is included in the 
  137.               library.  If  you do not want an object stored  in  this 
  138.               directory  to be included in the library then it  should 
  139.               be  purged.  There might not be enough memory to  create 
  140.               the library. 
  141.               Note:  This  is  not in accordance  with  "USERLIB.EXE". 
  142.               USERLIB does not include stored objects into the library 
  143.               whose names are in the $VARS list. 
  144.  
  145.     $CONFIG   A program executed at 'configuration time'.  For example 
  146.               <<  1791  ATTACH >>.  If you do not want $CONFIG  to  be 
  147.               shown  in  the  library  menu  then  $CONFIG  should  be 
  148.               included in the $HIDDEN list. 
  149.  
  150.     Three  other variables are:   $T1,  $T2,  and   $T3.  These  three 
  151.     variables are used by  ->LIB for internal purposes. 
  152.  
  153.     If you have more than 32k ram memory then you can recall TOOLS.DIR 
  154.     and  store  it under another name.  Put the name in level one  and 
  155.     press  ->LIB.  About 4 minutes later you'll have Library 1791. 
  156.  
  157.     7. 'EXTRACT'   - Extract objects from libraries 
  158.  
  159.     8. 'XTRACT'    - Subroutine used by EXTRACT 
  160.  
  161.     EXTRACT takes a list that contains either an XLIB name or two real 
  162.     numbers.  The two numbers are ordered [ object number,  LIB.ID  ]. 
  163.     For example [ 10, 1791 ] is identical to [ XLIB 1791 10 ]. EXTRACT 
  164.     creates  a  directory  'TMPDIR' where the  extracted  objects  are 
  165.     stored.  If  there does not exist a name for the extracted  object 
  166.     then a name indicating the ID number and object number is created. 
  167.     For  example  'L1791.10'  would replace XLIB 1791  10.  With  this 
  168.     program it was possible to recover a directory that was  converted 
  169.     to a library with ->LIB before being backed up. 
  170.  
  171.     9. 'S->ARRAY'  - string to Array of String object 
  172.  
  173.     S->ARRAY takes a list of strings from level one and converts it to 
  174.     an Array of String. All objects in the list are first converted to 
  175.     strings  before they are attached to the array.  Array of  Strings 
  176.     are  used  mainly  for library error messages.  Array  of  Strings 
  177.     cannot be edited. 
  178.  
  179.     10. 'AR->STR'   - Array of String object to string 
  180.  
  181.     AR->STR  takes an Array of Strings from level one and converts  it 
  182.     to  a  list  of strings.  This way you can  reedit  the  list  and 
  183.     thereafter converted back to an Array of String. 
  184.  
  185.     11. 'RVRS'      - Reverse a string 
  186.  
  187.     RVRS takes a string from level one and reverses the characters  so 
  188.     that  the first character becomes the last character and the  last 
  189.     becomes the first.  This is all done in machine code so it is very 
  190.     fast. 
  191.  
  192.     12. 'CRC'       - Checksum  ( Cyclic Redundancy Check ) 
  193.  
  194.     CRC  takes  a  string  (created  by using  DECOM48)  and  finds  a 
  195.     checksum.  This again is done in machine code.  If this string  is 
  196.     compiled  using ASM48 and thereafter pressing BYTES it would  give 
  197.     the same checksum. 
  198.  
  199.     13. 'F&R'       - Find and Replace 
  200.  
  201.     F&R  takes  three strings from the stack.  It takes the string  in 
  202.     level 2, finds its occurence in the string in level 3 and replaces 
  203.     it with the string from level 1.  It repeats the search until  all 
  204.     occurrences  of string from level 2 are replaced by the string  in 
  205.     level 1. F&R is a subroutine of  programs  ->LIB and DNL. 
  206.  
  207.     14. 'DFL'       - Delete from List 
  208.  
  209.     DFL takes 2 lists form the stack.  If any of contents of both list 
  210.     are  the  same then it is deleted from the list in level  2.  This 
  211.     program is a subroutine of ->LIB. 
  212.  
  213.  
  214.     The  rest of the programs were developed by others and I  am  very 
  215.     greatful  to  them for making them public.  These programs can  be 
  216.     found in the BBS with documentation. 
  217.  
  218.     15. 'SYSRCL'    - Recall object to stack 
  219.  
  220.     16. 'FIND'      - Find object in memory 
  221.  
  222.     17. 'PEEK'      - Return values from memory 
  223.  
  224.     18. 'POKE'      - Place values in memory 
  225.  
  226.     19. '->PRG'     - Combine objects into a program 
  227.  
  228.     20. 'PRG->'     - Separate a program into it components 
  229.  
  230.  
  231.     There are no warranties of any kind. Use at your own risk. 
  232.  
  233.  
  234.     From:                                    Date: 25 Jan 1991 
  235.  
  236.     Frank Ochoa 
  237.     Poul La Cours Vej 25, 1th 
  238.     8660 Skanderborg 
  239.     Denmark 
  240.